<?php
$do_magic=false;
if(!get_magic_quotes_gpc())
   $do_magic=true;
while(list ($key, $val) = each ($_POST)) {
   if($do_magic)
      $$key=addSlashes($val);
   else
      $$key=$val;
}
while(list ($key, $val) = each ($_GET)) {
    if($do_magic)
      $$key=addSlashes($val);
   else
      $$key=$val;
}
while(list ($key, $val) = each ($_FILES)) {
    if($do_magic)
      $$key=addSlashes($val);
   else
      $$key=$val;
}
?>